#ifndef _NET_EXECUTION_H_
#define _NET_EXECUTION_H_
#include "hxgrid/Interface/IAgent.h"
#include "hxgrid/Interface/hxgridinterface.h"
namespace lc_net
{
	class task;
	class result;
	class net_execution
	{
					u32 					_id;
		
	public:
					u32						id				( ) const { return _id ;}	
		virtual		u32 					type			( )	=0;

		virtual		void					send_task		( IGridUser& user, IGenericStream* outStream, u32  id )	=0;
		virtual		LPCSTR					data_files		() =0;
		virtual		void					receive_result	( IGenericStream* outStream )	=0;
		virtual		bool					receive_task	( IAgent* agent, DWORD sessionId, IGenericStream* inStream ) = 0;
		virtual		void					send_result		( IGenericStream* outStream )	=0;
		virtual		bool					execute			()	=0;
		

											net_execution	( ): _id(u32(-1)){}
											net_execution	( u32 id ): _id(id){}
		virtual								~net_execution	()	{};	
	private:

	};

	enum execution_types
	{
		et_lightmaps,
		
		et_last
	};
	

	
	template < execution_types etype >
	class tnet_execution_base:
		public net_execution
	{
	public:
		static const execution_types	class_type =	 etype;
		class		 net_execution_impl;
	public:
					tnet_execution_base	( u32 id ): net_execution(id){}

		virtual		net_execution_impl	&implementation	( ) = 0;
	private:
	
		virtual		u32 				type			( )	{ return (u32) class_type; }

	};

};
#endif